{include file='common/header'/}
<div class="row">
    <div class="col-md-3">
        <div class="panel panel-default">
            <div class="panel-heading">欢迎留言</div>
            <div class="panel-body">
                欢迎留言，请尽量填写能方便联系到您的联系方式，我们将尽快联系您！
            </div>
        </div>
    </div>
    <div class="col-md-9">
        <div class="panel panel-default">
            <div class="panel-body">
                <h1>
                    <div class="btn-group pull-right">
                        <a href="{:url('index/auth/login')}" class="btn btn-primary">用户登录</a>
                        <a href="{:url('index/auth/reg')}" class="btn btn-primary">会员注册</a>
                        <a href="{:url('index/auth/password')}" class="btn btn-primary">找回密码</a>
                    </div>
                    用户登录
                </h1>
                <hr>
                <form class="form-horizontal well" id="login_form" method="post" onsubmit="return EBCMS.AUTH.login();" action="{:url('index/auth/login')}">
                    <div class="form-group">
                        <label for="email" class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10">
                            <input name="email" type="text" class="form-control" id="email">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="password" class="col-sm-2 control-label">密码</label>
                        <div class="col-sm-10">
                            <input name="password" type="password" class="form-control" id="password">
                        </div>
                    </div>
                    {if condition="ebconfig('user.login_verify')==1"}
                        {include file='common/verify' /}
                    {/if}
                    <input type="hidden" name="go" value="{:input('go')}">
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-primary" >提交</button>
                        </div>
                    </div>
                </form>
                <script>
                    Namespace.register("EBCMS.AUTH");
                    $(function(){
                        EBCMS.AUTH.login = function(){
                            $.ajax({
                                url: '{:url('index/auth/login')}',
                                type: 'POST',
                                dataType: 'json',
                                data: $('#login_form').serialize(),
                                success:function(data){
                                    if (data.code) {
                                        self.location=data.url;
                                    }else{
                                        alert(data.msg);
                                        EBCMS.FN.change_verify('#verify_img');
                                    }
                                }
                            });
                            return false;
                        };
                    });
                </script>
            </div>
        </div>
    </div>
</div>
{include file='common/footer' /}